package com.clarencezero.mylover.controller;

import com.clarencezero.mylover.config.springsecurity.Menu;
import com.clarencezero.mylover.param.Result;
import com.clarencezero.mylover.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping(value = "/menu/")
public class MenuController {
    @Autowired
    MenuService menuService;

    @GetMapping("listAllMenu")
    @ResponseBody
    public Result listAllMenu() {
        Result result = new Result();
        result.setCode(200);
        result.setMsg("获取成功");
        List<Menu> resultList = menuService.listAllMenu();
        result.setData(resultList);
        return result;
    }
}
